/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package client.domainModels.NodeImpl;

import java.util.ArrayList;

import client.domainModels.Node.Node;



/**
 * 
 * @author Wei WANG
 */
public class Event extends AbstractNode {

	public String[] getChildNodeNames() {
		String[] strings = {"Actor", "Task", "Performative", "Receivers", "Conversation", "ProjectDate" };
		return strings;
	}

	public String[] getNodeAttributes() {
		// TODO Auto-generated method stub
		String[] attributes = {"ID"};
		return attributes;
	}
	
	public String toString(){
		return "Event: "+getID();
	}

	@Override
	public String getStringRepresentation() {
		// TODO Auto-generated method stub
		String ret ="<event>\n";
		ret += childReader("Task");
		ret += childReader("Performative");
		ret += childReader("Actor");
		ret += childReader("Receivers");
		ret += childReader("Conversation");
		ret += childReader("Date");
		ret += "</event>\n";
		return ret;
	}
	
	private String childReader(String type){
		String ret="";
		ArrayList<Node> aux = this.getChildNodes(type);
		if (aux != null){
			for(int i = 0;i<aux.size();i++){
				ret+=aux.get(i).getStringRepresentation();
			}
		}
		return ret;
	}
}
